package org.example.controller.backup;

import org.example.common.result.ResponseData;
import org.example.flowable.handler.TaskHandler;
import org.flowable.task.api.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * 任务处理人相关
 */
@RestController
@RequestMapping("api/flow/user")
public class UserController {

    protected static Logger logger = LoggerFactory.getLogger(UserController.class);
    @Autowired
    private TaskHandler taskHandler;

    /**
     * 执行流程任务
     */
    @RequestMapping(value = "/transferTask", method = RequestMethod.GET)
    @ResponseBody
    public ResponseData<Task> transferTask(String taskId, String userId) throws Exception {
        taskHandler.setAssignee(taskId,userId);
        return ResponseData.success();
    }
}

